DriverGestaltExplorer is both sample code showing how to call Driver Gestalt and a useful tool for testing your block device driver’s support of Driver Gestalt.
About Driver Gestalt
Driver Gestalt is a standard set of _Control and _Status calls that allow the system and applications to query device drivers about their functionality. The focus of Driver Gestalt is block storage device drivers. All block storage drivers should provide at least a minimal implemention of Driver Gestalt.
“Designing PCI Cards and Drivers for Power Macintosh Computers” includes high-level documentation for Driver Gestalt. In addition, "DriverGestalt.h" provides documentation for specific selectors.
Packing List
The sample includes the following items:
• Read Me — DriverGestaltExplorer — This document.
• DriverGestaltExplorer.µ — A CodeWarrior project to build the DriverGestaltExplorer.
• DriverGestaltExplorer — A compiled fat binary of the above.
• DriverGestaltExplorer.c — The bulk of the sample code, including the main function.
• TradDriverLoaderLib1.0b5 — A folder containing a cut down version of TradDriverLoaderLib, a useful library for messing with drivers. The full version of this library is available on the Developer CDs.
Building the Sample
To build the sample you will need:
• The CodeWarrior Pro 3 C compiler.
Open the “DriverGestaltExplorer.µ” project file, select the FAT target, and make the project. This results in a fat version of the application.
Using DriverGestaltExplorer
DriverGestaltExplorer is a simple command line application. There are two effective commands:
'g' — This command lets you query a single Driver Gestalt selector on a drive you specify. You will be prompted for the drive number and the selector. If you enter a drive number of 0, all drives will be queried.
'G' — This command lets you query all the currently defined Driver Gestalt selectors on a drive you specify. You will be prompted for the drive number. If you enter a drive number of 0, all drives will be queried for all selectors.
Credits and Version History
DriverGestaltExplorer was written by Quinn “The Eskimo!” as Apple Developer Technical Support sample code. If you find any problems with this sample, mail <DevSupport@apple.com> with “Attn: Quinn” as the first line of your mail and I’ll try to fix them up.
Version 1.0d1 (Apr 1998) is the first release version.